package com.example.epic.bean.mq;

import com.example.epic.bean.InAndOutRecord;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class RocketMQSender {
    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    public void sendInOutRecord(InAndOutRecord inAndOutRecord){
        rocketMQTemplate.convertAndSend("first-topic", inAndOutRecord);
    }

    public void send(){
        rocketMQTemplate.convertAndSend("first-topic", "你好");
    }
}
